home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / CMPLTPAS / BOXTEST2.PAS < prev    next >
Pascal/Delphi Source File  |  1988-07-15  |  1KB  |  37 lines

  1. {--------------------------------------------------------------}
  2. {                          BoxTest2                            }
  3. {                                                              }
  4. {   Separate compilation demo program -- USES BOXSTUFF.TPU     }
  5. {                                                              }
  6. {                             by Jeff Duntemann                }
  7. {                             Turbo Pascal V5.0                }
  8. {                             Last update 7/14/88              }
  9. {                                                              }
  10. {     From: COMPLETE TURBO PASCAL 5.0  by Jeff Duntemann       }
  11. {    Scott, Foresman & Co., Inc. 1988   ISBN 0-673-38355-5     }
  12. {--------------------------------------------------------------}
  13.  
  14. PROGRAM BoxTest;
  15.  
  16. USES CRT,BoxStuff;
  17.  
  18. TYPE
  19.   String80  = String[80];
  20.  
  21. VAR
  22.   X,Y          : Integer;
  23.   Width,Height : Integer;
  24.  
  25. BEGIN
  26.   Randomize;                 { Seed the pseudorandom number generator }
  27.   ClrScr;                    { Clear the entire screen }
  28.   WHILE NOT KeyPressed DO    { Draw boxes until a key is pressed }
  29.     BEGIN
  30.       X := Random(72);       { Get a Random X/Y for UL Corner of box }
  31.       Y := Random(21);
  32.       REPEAT Width := Random(80-72) UNTIL Width > 1;  { Get Random Height & }
  33.       REPEAT Height := Random(25-Y) UNTIL Height > 1; { Width to fit on CRT }
  34.       MakeBox(X,Y,Width,Height,GrafChars);            { and draw it! }
  35.     END
  36. END.
  37.